home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 May / Ahoy_Magazine_87-05_1987_Double_L_Side_A.d64 / Outcast Order 3 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  328b  |  10 lines

  1. 0 rem << cd41-6 >>
  2. 1 rem ==================================
  3. 2 rem    commodares problem #37-2 :
  4. 3 print"[147]outcast order"
  5. 4 rem    solution by
  6. 5 rem    mike strawn
  7. 6 rem ==================================
  8. 10 input"n,m";n,m :dim a(n) :for i=0 to n-1: a(i)=i+1 : next : a(n)=1
  9. 20 for i=1 to m: pp=p: p=a(p): next: print p;: a(pp)=a(p): if p<>pp then 20
  10.